package action;

import com.opensymphony.xwork2.ActionSupport;
import org.apache.struts2.ServletActionContext;

import java.io.InputStream;

/**
 * 下载文件
 */
public class DownloadAction extends ActionSupport{
    private String inputPath;

    public InputStream getTargetFile() throws Exception{
        return ServletActionContext.getServletContext().getResourceAsStream(getInputPath());
    }

    public String getInputPath() {
        return inputPath;
    }

    public void setInputPath(String inputPath) {
        this.inputPath = inputPath;
    }
}
